#ifndef CHART_H
#define CHART_H

#include <QWidget>
#include <QCheckBox>
#include <QString>
#include <QtCharts/QChartView>

class Chart : public QWidget
{
    Q_OBJECT
public:
    explicit Chart(QWidget *parent = 0,QString &str = QString());

    void initUI();
    void addSeries(QString &name,QVector<qreal>&value);

signals:

public slots:
    void on_cbBone_clicked(bool);
    void on_cbCow_clicked(bool);
    void on_cbBunny_clicked(bool);

private:
    QT_CHARTS_NAMESPACE::QChartView *chartView = nullptr;
    QString chartTitle;
    QCheckBox *cbBone;
    QCheckBox *cbCow;
    QCheckBox *cbBunny;

    void createChart();
    void createChechBox();
    void createLayout();

    static QMap<QString,QVector<qreal>>Bone;
    static QMap<QString,QVector<qreal>>Cow;
    static QMap<QString,QVector<qreal>>Bunny;
};

#endif // CHART_H
